﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Darwin.Source.Components.World.Entities
{
    class CCursor
    {
        private Vector3 m_v3Position;

        public Vector3 Position
        {
            get
            {
                return m_v3Position;
            }

            set
            {
                m_v3Position = value;
            }
        }

        public CCursor()
        {
        }

        public void Draw()
        {
#if DEBUG_GRAPHICS_ENABLED
            //
            //  Given a valid XZ value the terrain will return to you a height at that point, and the normal of the triangle you are on
            //
            Vector3 v3Normal;
            m_v3Position.Y = Singleton<SunXNA.Terrain.CTerrain>.Instance.GetHeightAtXZ(m_v3Position, out v3Normal);

            UInt32 key = 1000;

            Singleton<SunXNA.DebugGraphics.CManager>.Instance.Add3DObject(++key,                            //you decide the UID, theres a very good reason for this...
                                                                          SunXNA.DebugGraphics.Type.Box,    //only boxes are available =]
                                                                          Color.Red,                        //any color you like
                                                                          m_v3Position,                     //send in a world position
                                                                          v3Normal,                         //this is the direction it will face
                                                                          new Vector3(0.2f, 0.2f, 10.0f),   //this is scale, z scale is the scale along the direction... so this code will make it 5 tall... because its pointing up =]
                                                                          1.0f);                            //how long the graphic is alive for, < 0.0f will last FOREVAR!! ^__^


            Singleton<SunXNA.DebugGraphics.CManager>.Instance.Add3DObject(++key,                            //you decide the UID, theres a very good reason for this...
                                                                          SunXNA.DebugGraphics.Type.Box,    //only boxes are available =]
                                                                          Color.Red,                        //any color you like
                                                                          m_v3Position,                     //send in a world position
                                                                          v3Normal,                         //this is the direction it will face
                                                                          new Vector3(3.0f,3.0f, 1.0f),     //this is scale, z scale is the scale along the direction... so this code will make it 5 tall... because its pointing up =]
                                                                          1.0f);     


#endif

        }
    }
}
